<?php

namespace app\index\controller;
use app\FrontController;
use think\facade\Db;
use think\facade\Cache;
use think\facade\Validate;
use support\Request;
class UserController extends FrontController{

    private $uuid = '';
    public function __construct()
    {
        parent::__construct();
    }
    public function user()
    {
        $tab = array("tab"=>"1-1");
        $tab = array_merge($tab,$this->assign_arr);
        return view("user/user",$tab);
    }
    public function auth()
    {
        $tab = array("tab"=>"1-3");
        $tab = array_merge($tab,$this->assign_arr);
        return view("user/auth",$tab);
    }
    public function authadd()
    {
        $tab = array("tab"=>"1-3");
        $tab = array_merge($tab,$this->assign_arr);
        return view('user/authadd',$tab);
    }
    public function updateinfo()
    {
        $tab = array("tab"=>"1-2");
        $tab = array_merge($tab,$this->assign_arr);
        return view('user/updateinfo',$tab);
    }
    public function vipadd()
    {
        $tab = $this->assign_arr;   
        return view('user/vipadd',$tab);
    }
    public function changepwd()
    {
        $tab = array("tab"=>"1-5");
        $tab = array_merge($tab,$this->assign_arr);
        return view('user/changepwd',$tab);
    }
    public function online()
    {
        $param = $this->request->all();
        if(isset($param['from'])){
            $param['from'] = intval($param['from']);
        } else {
            $param['from'] = 0;
        }
        if(isset($param['money'])){
            $param['cash'] = ceil(intval($param['money'])/100);
            if($param['cash']<10){
                $param['cash'] = 10;
            }
        } else {
            $param['cash'] = '';
        }
        $param["tab"] = '2-1';
        $param = array_merge($param,$this->assign_arr);
        return view('user/online',$param);
    }
    public function taskpub()
    {
        $tab = array("tab"=>"3-2");
        $tab = array_merge($tab,$this->assign_arr);
        return view("user/taskpub",$tab);
    }
    public function jointask()
    {
        $tab = array("tab"=>"4-1");
        $tab = array_merge($tab,$this->assign_arr);
        return view("user/jointask",$tab);
    }
    public function moneylog()
    {
        $tab = array("tab"=>"2-3");
        $tab = array_merge($tab,$this->assign_arr);
        return view("user/moneylog",$tab);
    }
    public function withdrawallog()
    {
        $tab = array("tab"=>"2-5");
        $tab = array_merge($tab,$this->assign_arr);
        return view("user/withdrawallog",$tab);
    }
    public function rechargelog()
    {
        $tab = array("tab"=>"2-6");
        $tab = array_merge($tab,$this->assign_arr);
        return view("user/rechargelog",$tab);
    }
    public function edittask()
    {
        $param = $this->request->all();
        if(!isset($param['id'])){
            $id = 0;
        } else {
            $id = $param['id'];
        }
        $tab = array('id'=>$id);
        $tab = array_merge($tab,$this->assign_arr);
        return view("user/edittask",$tab);
    }
    public function withdrawal()
    {
        $tab = array("tab"=>"2-2");
        $tab = array_merge($tab,$this->assign_arr);
        return view("user/withdrawal",$tab);
    }
    public function help()
    {
        $tab = $this->assign_arr;
        return view('user/help',$tab);
    }
    public function reputation()
    {
        $tab = array("tab"=>"1-4");
        $tab = array_merge($tab,$this->assign_arr);
        return view("user/reputation",$tab);
    }
    public function integrallog()
    {
        $tab = array("tab"=>"2-4");
        $tab = array_merge($tab,$this->assign_arr);
        return view("user/integrallog",$tab);
    }
}